Booting Petalinux via TFTP and NFS

TFTP Server Setup

In this environment, the server directory is /srv/tftp.

Petalinux Configuration (for TFTP)

 

image-20250825140239589

image-20250825141522889

Select Command line interface-> Network commands->serverip variable takes precedent over DHCP server IP

image-20250825141947553

image-20250825142026532

image-20250825142052483

Booting Petalinux Using TFTP

Follow the steps below to connect the development board to the computer. The steps are basically the same as before.

In this state, there is no bootloader, and there is no output on the serial console yet. To boot via JTAG, run the following command in the Petalinux project directory on the host PC:

This will output boot logs to the serial console.

Note: When entering petalinux-boot --jtag --u-boot --fpga --hw_server-url TCP:Ubuntu20:3121 reports an error, check:

Configure u-boot on this serial console for TFTP boot.

The setup is complete. Restart the development board, then run petalinux-boot --jtag --u-boot --fpga --hw_server-url TCP:Ubuntu20:3121 again. Linux will boot, and you can log in as before.

Since the dhcp;pxe get;pxe boot; command uses DHCP to automatically assign an IP address, which may cause failure to enter the Linux system, you can set the board's IP address at this step. Ensure that the IP addresses on both sides are the same.

Now you can boot Petalinux over the network using TFTP. This way, you don't need to place images on the SD card every time you customize and run petalinux-build. A power cycle of the development board is required.

However, with this method, rootfs.cpio.gz.u-boot is extracted and used every time it boots, and any edits made will not be saved after Linux starts.

If rootfs is set to be located on the ROOT partition of the SD card, the results of edits will be saved on the SD card.

This issue can be resolved using NFS (see next section):

NFS Server Setup

Petalinux Configuration (for NFS)

Run petalinux-config, select Image Packaging Configuration, and change Root filesystem type to NFS. Change Location of NFS root directory to the NFS server directory /srv/nfs.

image-20250826145501180

 

NFS 4.1 appears after NFS 4 is enabled, NFS 4.2 appears after NFS 4.1 is enabled.

image-20250825101940757

image-20250825102358625

Build the device tree to see the changes: it contains information related to NFS.

 

Booting Petalinux Using TFTP + NFS

Since the rootfs is located on the host PC, any edited content will not be lost each time the board is rebooted.